-- GENERATED SPELL FOR [Decomposed Ghoul] --


function spell0_31812(pUnit, Event) --@Enrage,Self--
pUnit:FullCastSpellOnTarget(15716,pUnit)
pUnit:RegisterEvent('Sorts_31812', 609, 1)
end

function spell1_31812(pUnit, Event) --@Pierce Armor,n/a--
pUnit:FullCastSpellOnTarget(12097,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31812', 20344, 1)
end

function Sorts_31812(pUnit, Event)
local choix_sorts_31812 = math.random(0, 1)
if choix_sorts_31812 == 0 then
pUnit:RegisterEvent('spell0_31812', 1, 1)
end
if choix_sorts_31812 == 1 then
pUnit:RegisterEvent('spell1_31812', 1, 1)
end
end

function mob31812_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_31812', math.random(1500, 3000), 1)
end

function mob31812_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31812_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31812_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(31812, 1, 'mob31812_Action')
RegisterUnitEvent(31812, 2, 'mob31812_Leave')
RegisterUnitEvent(31812, 3, 'mob31812_Kill')
RegisterUnitEvent(31812, 4, 'mob31812_Die')
